﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="TrustRegionList.aspx.cs" Inherits="AB.ServiceDirectory.Design.Geography.TrustRegionList" %>

<%@ Import Namespace="AB.ServiceDirectory" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript">
        function Confirm_Active() {
            return confirm('Do you want to make this Trust Region active ?');
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentTitle" runat="server">
    <h2>
        Trust Region List</h2>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="Content" runat="server">
    <asp:UpdatePanel runat="server" ID="UpdatePanelTrustRegionsList">
        <ContentTemplate>
            <div class="grid740 simplebox">
                <div class="titleh">
                    <h3 class="sorting_range">
                        <asp:LinkButton ID="LinkButtonAll" runat="server" OnCommand="FilterByLetters_Command"
                            CommandName="all" ClientIDMode="Static" CssClass="hg-blue">All</asp:LinkButton>
                        <asp:LinkButton ID="LinkButton09" runat="server" CommandName="09" OnCommand="FilterByLetters_Command"
                            ClientIDMode="Static">0-9</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonAE" runat="server" CommandName="ae" OnCommand="FilterByLetters_Command"
                            ClientIDMode="Static">A B C D E</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonFJ" runat="server" CommandName="fj" OnCommand="FilterByLetters_Command"
                            ClientIDMode="Static">F G H I J</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonKN" runat="server" CommandName="kn" OnCommand="FilterByLetters_Command"
                            ClientIDMode="Static">K L M N </asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonOR" runat="server" CommandName="or" OnCommand="FilterByLetters_Command"
                            ClientIDMode="Static">O P Q R</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonSV" runat="server" CommandName="sv" OnCommand="FilterByLetters_Command"
                            ClientIDMode="Static">S T U V</asp:LinkButton>
                        <asp:LinkButton ID="LinkButtonWZ" CssClass="last" runat="server" CommandName="wz"
                            OnCommand="FilterByLetters_Command" ClientIDMode="Static">W X Y Z</asp:LinkButton>
                        <span class="right">
                            <asp:LinkButton ID="LinkButtonCreate" runat="server" CssClass="hg-blue" OnClick="LinkButtonCreate_Click">Create</asp:LinkButton>
                            <asp:CheckBox ID="CheckBoxInactive" runat="server" Text="Include In-active" AutoPostBack="True"
                                OnCheckedChanged="CheckBoxInactive_CheckedChanged" />
                        </span>
                    </h3>
                </div>
                <asp:GridView ID="GridViewDepartmentList" runat="server" CssClass="tablesorter" AutoGenerateColumns="False"
                    DataSourceID="ObjectDataSourceTrustRegionsList" AllowPaging="True" PageSize="15"
                    AllowSorting="True">
                    <Columns>
                        <asp:TemplateField HeaderText="Trust Region Name" SortExpression="TrustRegionName">
                            <ItemTemplate>
                                <asp:LinkButton ID="LinkButtonTrustRegionName" CausesValidation="false" runat="server"
                                    CommandName='<%# Eval("TrustRegionId") %>' CommandArgument='<%#Eval("IsActive") %>'
                                    OnClientClick='<%# !(bool)Eval("IsActive") ? "return Confirm_Active();" : string.Empty %>'
                                    OnCommand="LinkButtonTrustRegionName_Command"><%# Eval("TrustRegionName")%></asp:LinkButton>
                            </ItemTemplate>
                            <HeaderStyle CssClass="header" />
                            <ItemStyle Width="150px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Description" SortExpression="Description">
                            <ItemTemplate>
                                <%#StringTools.Substring(Eval("Description"), 0, 50, true)%>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left" CssClass="header" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Nation/Country" SortExpression="NationCountry">
                            <ItemTemplate>
                                <%#Eval("Country.CountryName")%>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left" CssClass="header" />
                            <ItemStyle Width="120px" />
                        </asp:TemplateField>
                        <asp:TemplateField HeaderText="Is Active?" SortExpression="IsActive">
                            <ItemTemplate>
                                <%#(bool)Eval("IsActive") ? "Yes" : "No"%>
                            </ItemTemplate>
                            <HeaderStyle HorizontalAlign="Left" CssClass="header" />
                            <ItemStyle Width="90px" />
                        </asp:TemplateField>
                    </Columns>
                    <EmptyDataTemplate>
                        <blockquote>There are no items to show.</blockquote>
                    </EmptyDataTemplate>
                    <PagerStyle CssClass="pagination_table" />
                </asp:GridView>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:ObjectDataSource ID="ObjectDataSourceTrustRegionsList" runat="server" TypeName="AB.ServiceDirectory.BO.TrustRegionsBO"
        SelectMethod="GetTrustRegion" OnSelecting="ObjectDataSourceTrustRegions_Selecting"
        EnablePaging="True" SelectCountMethod="GetTrustRegionCount" StartRowIndexParameterName="startRowIndex"
        MaximumRowsParameterName="maxRows" SortParameterName="sortType">
        <SelectParameters>
            <asp:Parameter Name="filter" Type="Object" ConvertEmptyStringToNull="False" />
        </SelectParameters>
    </asp:ObjectDataSource>
</asp:Content>
